-
-
Notifications
You must be signed in to change notification settings - Fork 822
feat: add math/base/special/tribonaccif
#6066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Coverage Report
The above coverage report was generated for the changes in this PR. |
#include "stdlib/constants/float32/max_safe_nth_tribonacci.h" | ||
#include "stdlib/math/base/assert/is_nanf.h" | ||
|
||
static const int32_t tribonaccif_value[ 31 ] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
went with 31 values here.
cc:- @kgryte @Planeshifter LMK what am I missing here!! |
@Planeshifter Hey could I pls know why the |
@Neerajpathak07 Simple, because you consistently use Because you consistently use |
@kgryte ahh I see alright then I shall update all the other PR's for this. |
2555757, | ||
4700770, | ||
8646064, | ||
15902591 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have taken values till here as the FLOAT32_MAX_SAFE_INTEGER
is 16777215 so any value beyond this just returns NaN
if ( n < 0 || n > STDLIB_CONSTANT_FLOAT32_MAX_SAFE_NTH_TRIBONACCI ) { | ||
return 0.0 / 0.0; // NaN | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't added cases for is_nanf
and to check if n
is int. As while operating on int32_t
variables we don't want to return NaN
for integers and NaN
itself.
@kgryte Kindly review this and LMK if I am missing something!! |
* @example | ||
* var y = tribonaccif( 6 ); | ||
* // returns 7 | ||
* | ||
* @example | ||
* var y = tribonaccif( -1 ); | ||
* // returns NaN | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also removed the example for testing tribonaccif
value for 3.14
integer. As it just truncates the value and return s 0 which is undesirable.
lib/node_modules/@stdlib/math/base/special/tribonaccif/README.md
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/special/tribonaccif/README.md
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/special/tribonaccif/README.md
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/special/tribonaccif/README.md
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/special/tribonaccif/README.md
Outdated
Show resolved
Hide resolved
@Neerajpathak07 Looks like this PR is missing |
@gunjjoshi Let me get back to you with the updated changes!! |
/stdlib merge |
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: na - task: lint_c_benchmarks status: passed - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
Progresses #649.
Description
This pull request:
math/base/special/tribonaccif
which is the single-precision version oftribonacci
Related Issues
This pull request:
Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers